﻿@using AntDesign.Charts;

@if (radarData == null)
{
	<Loading></Loading>
}
else
{
	<Radar Data=" radarData" Config="config" />
}



@code {
    public class RadarData
    {
        public string type;
        public string item;
        public double value;
    }
    [Parameter]
    public object[] radarData { get; set; }
    [Parameter]
    public int height { get; set; }
    [Parameter]
    public int width { get; set; }
    protected override void OnParametersSet()
    {
        config.Height = height;
        config.Width = width;
        base.OnParametersSet();
    }
    readonly RadarConfig config = new RadarConfig
    {
        XField = "type",
        YField = "value",
        SeriesField = "item",
        RadiusAxis = new ValueAxis
        {
            Grid = new BaseAxisGrid
            {
                Line = new BaseAxisGridLine
                {
                    Type = "line"
                }
            }
        },
        Line = new RadarViewConfigLine
        {
            Visible = true,
        },
        Point = new RadarViewConfigPoint
        {
            Visible = true,
            Shape = "circle"
        },
        Legend = new AntDesign.Charts.Legend
		{
            Visible = true,
            Position = "bottom-center"
        },
	};

	//protected override void OnParametersSet()
	//{
	//	base.OnParametersSet();
	//}
}
